package nGui.controls.containers;

import neko.Lib;
import nGui.controls.Control;

class Tabs extends Control
{
	public var position(null,setPosition) : String;
	public var onChange(default,change) : Void -> Void -> Int;

	public function new( elements : Array<Control> )
	{
		super();
		var arr = new Array();
		for ( a in elements )
			arr.push( untyped a.__c );
		__c = ngui_element_tabs( untyped arr.__a );
	}

	private function change( func : Void -> Void -> Int )
	{
		Reflect.setField(this,"onChange",func);
		this.setCallback( "TABS_CB", onChange, null );
		return func;
	}

	// TOP, BOTTOM, LEFT or RIGHT
	private function setPosition( val : String )
	{
		setAttribute( "TABTYPE", val );
		return null;
	}
	
	static var ngui_element_tabs = neko.Lib.load("nGui","ngui_element_tabs",1);
}